#include <vcg/simplex/vertex/base.h>
#include <vcg/simplex/vertex/component.h>
#include <vcg/complex/used_types.h>

#include<vcg/simplex/face/base.h>
#include<vcg/simplex/face/component.h>

#include<vcg/simplex/face/topology.h>
#include<vcg/complex/complex.h>

// input output
#include<wrap/io_trimesh/import.h>
#include<wrap/io_trimesh/export.h>

// topology computation
#include<vcg/complex/algorithms/update/topology.h>

// normals
#include<vcg/complex/algorithms/update/normal.h>

using namespace vcg;
using namespace std;


/* initialize the mesh storing model */
class   MyEdge;
class   MyFace;
class   MyVertex;
struct  MyUsedTypes : public UsedTypes
	<	Use<MyVertex>   ::AsVertexType,
        Use<MyEdge>     ::AsEdgeType,
        Use<MyFace>     ::AsFaceType   > {};

class MyVertex  : public Vertex<MyUsedTypes, vertex::Coord3f, vertex::Normal3f, vertex::BitFlags  >{};
class MyFace    : public Face< MyUsedTypes, face::FFAdj,  face::VertexRef, face::BitFlags > {};
class MyEdge    : public Edge<MyUsedTypes>{};
class MyMesh    : public tri::TriMesh< vector<MyVertex>, vector<MyFace>,vector<MyEdge> > {};

class MyImporter 
{
public:
	MyImporter() {};
	~MyImporter() {};
	void Import(MyMesh& m, char* fileName) 
	{
		
		tri::io::ImporterPLY<MyMesh>::Open(m, fileName, (vcg::CallBackPos*) 0);
		tri::UpdateTopology<MyMesh>::FaceFace(m);
		tri::UpdateFlags<MyMesh>::FaceBorderFromFF(m);
		tri::UpdateNormals<MyMesh>::PerVertexNormalized(m);
		// still need error catching

	}
private:

};
